<?php
include_once("modules/checkA.php");
include_once("../config.php");  


$sql = "DELETE FROM ".$table_prefix."orderlist WHERE (user_id = '' or  user_id is null) AND (user_name = '' or  user_name is null ) ";
$res = mysql_query($sql);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once('modules/head.php'); ?>

</head>

<body>

<div id="topbar"><?php include 'modules/topbar.php'; ?></div>

<div id="container">

    <div id="maincontent">

        <div id="sidebar">
            <?php include 'modules/sidebar.php'; ?>
        </div>


        <div id="content">

            <h1>统计信息</h1>





            <? $datelist=array(


                date("Y-m-d",strtotime('-5 day')),
                date("Y-m-d",strtotime('-4 day')),
                date("Y-m-d",strtotime('-3 day')),
                date("Y-m-d",strtotime('-2 day')),
                date("Y-m-d",strtotime('-1 day')),
                date("Y-m-d"),
                date("Y-m-d",strtotime('+1 day')),
                date("Y-m-d",strtotime('+2 day'))
            );

            $datelist_str=implode("','",$datelist);
            $orderlist=select_lines_all_items($table_prefix."orderlist","","order_date in ('".$datelist_str."') and (status != '取消' or status is null) ","");


            ?>

            <table class="layui-table">
                <colgroup>
                    <col width="80">
                    <col width="200">
                    <col >
                    <col>
                </colgroup>
                <thead>
                <tr>
                    <th>序号</th>
                    <th>日期</th>
                    <th>早餐订单数</th>
                    <th>午餐订单数</th>
                    <th>晚餐订单数</th>
                </tr>
                </thead>
                <tbody>
                <?for($i=0;$i<count($datelist);$i++){?>
                    <tr>
                        <td><?echo $i+1?></td>
                        <td><?echo $datelist[$i]?></td>
                        <?
                        $condition['data']=$orde_date_rlist;
                        $condition['rang']="";
                        $condition['target']="order_date"?>
                        <td><?echo count_with_2_key_in_2d_array($orderlist,"order_at","1","order_date",$datelist[$i])?></td>
                        <td><?echo count_with_2_key_in_2d_array($orderlist,"order_at","2","order_date",$datelist[$i])?></td>
                        <td><?echo count_with_2_key_in_2d_array($orderlist,"order_at","3","order_date",$datelist[$i])?></td>



                    </tr>
                <?}?>


                </tbody>
            </table>








<!--content端點01-->
</div>

<!--maincontent端點01-->
<br class="clearfloat"/>
</div>

<!--container端點01-->
</div>




<?php include_once('modules/footer.php'); ?>
</body>
</html>
